#include <linux/init.h>
#include <linux/module.h>
#include <linux/platform_device.h>

static void pdev_release(struct device *dev) {
	printk("-------release------\n");
}

struct platform_device pdev={
	.driver_override = "p001",
	.dev = {
		.release = pdev_release, //if not have this, rmmod not success
	},
};

static int __init pdev_init(void) {
	return platform_device_register(&pdev);
}

static void __exit pdev_exit(void) {
	platform_device_unregister(&pdev);
}

module_init(pdev_init);
module_exit(pdev_exit);

MODULE_LICENSE("GPL");

